package smu.KYBank;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class KYBmain extends Activity {
	Button deposit;
	Button withdraw;
	Button transfer;
	Button create;
	Button inquire;
	Button edit;
	Button delete;
	Button logout;
	Button quit;
	
	String login_id;
//	Intent intent;
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.kyb);
        
        Intent intent = getIntent();
		login_id = intent.getStringExtra("login_id");
		Toast.makeText(this, login_id + " login!! ", Toast.LENGTH_SHORT).show();
		
		
        deposit = (Button) findViewById(R.id.deposit);
        withdraw = (Button) findViewById(R.id.withdraw);
        transfer = (Button) findViewById(R.id.transfer);
        create = (Button) findViewById(R.id.create);
        inquire = (Button) findViewById(R.id.inquire);
        edit = (Button) findViewById(R.id.edit);
        delete = (Button) findViewById(R.id.delete);
        logout = (Button) findViewById(R.id.logout);
        quit = (Button) findViewById(R.id.quit);
        
        deposit.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBdeposit.class);
    			intent.putExtra("login_id", login_id);
    			
				startActivity(intent);
				
    		}
    	});
        
        withdraw.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBwithdraw.class);
				
    			intent.putExtra("login_id", login_id);
    			startActivity(intent);
				
    		}
    	});
        
        transfer.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBtransfer.class);
				startActivity(intent);
				finish();
    		}
    	});
        
        create.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBcreate.class);
				startActivity(intent);
				finish();
    		}
    	});
        
        inquire.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBinquire.class);
				startActivity(intent);
				finish();
    		}
    	});
        
        edit.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBedit.class);
				startActivity(intent);
				finish();
    		}
    	});
        
        delete.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBdelete.class);
				startActivity(intent);
				finish();
    		}
    	});
        
        logout.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			Intent intent = new Intent(KYBmain.this, KYBlogin.class);
				startActivity(intent);
				finish();
    		}
    	});
        
        quit.setOnClickListener(new OnClickListener() {
    		public void onClick(View v) {
    			finish();
    		}
    	});
    }
}
